<template>
  <div>
    <!-- 面包屑导航区 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ name:'WorkPlace' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>项目审核</el-breadcrumb-item>
      <el-breadcrumb-item>专利成果审核</el-breadcrumb-item>
      <el-breadcrumb-item>专利成果详情</el-breadcrumb-item>
    </el-breadcrumb>
    <!--返回按钮区-->
    <el-button type="primary" icon="el-icon-arrow-left" @click="back">返回</el-button>
    <!--logo项目名区-->
    <el-row :gutter="12">
      <el-col :span="3" class="colstyle">
        <img :src="logo" alt="" width="90" height="90">
      </el-col>
      <el-col :span="12" class="Titletext">{{ projectName }}</el-col>
      <el-col :span="12" class="Titletext"><el-tag>{{ list.departmentId }}</el-tag></el-col>
    </el-row>
    <!--项目信息表-->
    <div class="block">
      <div class="pjcard">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <i class="el-icon-s-management" />
            <span>项目信息</span>
          </div>
          <div class="text item">
            <el-row>
              <el-col :span="4">项目级别：{{ list.levelId }}</el-col>
              <el-col :span="4">项目性质：{{ list.natureId }}</el-col>
              <el-col :span="4">成果形式：{{ list.atId }}</el-col>
              <el-col :span="4">成果所属：{{ list.aodId }}</el-col>
              <el-col :span="4">结题形式：{{ list.ctId }}</el-col>
            </el-row>
          </div>
          <div class="text item">
            <el-row>
              <el-col :span="4">所在单位：{{ list.departmentId }}</el-col>
              <el-col :span="4">计划时间：{{ list.planTime }}</el-col>
              <el-col :span="4">项目经费：{{ list.outlay }}</el-col>
              <el-col :span="4">学科门类：{{ list.scId }}</el-col>
              <el-col :span="4">一级学科：{{ list.subjectId }}</el-col>
            </el-row>
          </div>
          <div class="text item" style="margin-top:px">
            项目概述：  {{ introduction }}
          </div>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <i class="el-icon-s-custom" />
            <span>团队信息</span>
          </div>
          <div class="text item">
            团队成员：<span v-for="(item, index) in team" :key="index">{{ item.userRealname + ' ' }}</span>
          </div>
        </el-card>
        <!-- <el-card class="box-card">
          <div slot="header" class="clearfix">
            <i class="el-icon-s-flag" />
            <span>获奖情况</span>
          </div>
          <div class="text item">
            列表内容
          </div>
          <el-button style="float: right; padding: 3px 0" type="text">下载附件</el-button>
        </el-card> -->
        <!--通过不通过按钮-->
        <div style="text-align: right;margin-top:20px;margin-bottom:50px;margin-right:30px;">
          <el-button type="success" round @click="approved">通过</el-button>
          <el-button type="danger" round>不通过</el-button>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import axios from 'axios'
export default {
  name: 'Patentdetail',
  data() {
    return {
      projectName: this.$route.params.data,
      peId: this.$route.params.key,
      logo: this.$route.params.Logo,
      // projectId: '2',
      introduction: this.$route.params.Introduction,
      list: this.$route.params.List,
      team: this.$route.params.Team,
      userId: '',
      flag: 1
    }
  },
  created() {
    this.projectName = JSON.parse(sessionStorage.getItem('data'))
    this.peId = JSON.parse(sessionStorage.getItem('key'))
    this.team = JSON.parse(sessionStorage.getItem('Team'))
    this.logo = JSON.parse(sessionStorage.getItem('Logo'))
    this.introduction = JSON.parse(sessionStorage.getItem('Introduction'))
    this.list = JSON.parse(sessionStorage.getItem('List'))
    // this.getLogo()
    this.getUser()
  },
  methods: {
    back() {
      this.$router.go(-1)
    },
    // getLogo() {
    //   axios.get('projectFile/getLogo', { params: { projectId: this.projectId }})
    //     .then((response) => {
    //       this.logo = response.data.data
    //     }).catch(error => {
    //       console.log(error)
    //     })
    // },
    approved() {
      axios.get(`pe/approved/${this.flag}`, { params: { peId: this.peId, reviewerId: this.userId }})
        .then((response) => {
          this.logo = response.data.data
          this.$message({
            message: '审核成功！',
            type: 'success'
          })
        }).catch(error => {
          console.log(error)
        })
    },
    getUser() {
      axios.get('/user/')
        .then((response) => {
          this.userId = response.data.data.userId
        }).catch(error => {
          console.log(error)
        })
    }
  }
}
</script>
<style lang="scss" scoped>
.Titletext{
  font-size: 20px;
  color: rgb(12, 5, 5);
  font-weight:bold;
}
.colstyle{
   vertical-align: middle;
}
.clearfix{
  font-size:15px;
  color:black;
  font-weight:bold;
}
 .text {
    font-size: 14px;
  }

  .item {
    margin-bottom: 5px;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }
  .clearfix:after {
    clear: both
  }

  .box-card {
    width: 88%;
    margin-left: auto;
    margin-right: auto;
  }
  .block {
    background-color:#DCDCDC;
    height:100%;
    padding-bottom:20px;
  }
  /* .pjcard {
  } */
</style>
